Skip to content

fix/feat: display version at start of all CLI contexts with empty line#30

Merged
nerdCopter merged 2 commits into
masterfrom
20251213_FIX_ISSUE_29
Dec 13, 2025
Merged

fix/feat: display version at start of all CLI contexts with empty line#30
nerdCopter merged 2 commits into
masterfrom
20251213_FIX_ISSUE_29

Conversation

@nerdCopter
Copy link
Copy Markdown
Owner

@nerdCopter nerdCopter commented Dec 13, 2025

Summary

Test Scenarios

  • Version shown for: -V, --version, --help, normal execution, no params
  • Format: bbl_parser <semver> <sha> (<date>) via vergen
  • All tests, clippy, and formatting pass

Closes #29

Summary by CodeRabbit

  • New Features
    • Added --version/-V CLI flags to display application version information.
    • Version is now shown at application startup.

✏️ Tip: You can customize this high-level summary in your review settings.

- Add version output to normal file processing (not just --version/--help)
- Format: 'bbl_parser 0.9.0 <git_sha> (<date>)' via vergen
- Prints only when processing files (after help early exit)
- No duplicate printing: --version/--help handled by clap separately
- Resolves issue #29
- Print version before get_matches() for all contexts
- Version shows for: -V, --version, --help, normal execution, no params
- Format: 'bbl_parser <semver> <sha> (<date>)' via vergen
- Empty line separates version from help/output
- Add custom -V/--version args with exclusive flag
- Early exit if only --version/-V requested
- Simple approach: print once at start, no duplication
- Resolves issue #29
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Dec 13, 2025

📝 Walkthrough

Walkthrough

Modified version display handling in src/main.rs by replacing clap's automatic version emission with explicit version printing before file processing and an early-exit condition for the --version flag.

Changes

Cohort / File(s) Change Summary
Version Display Logic
src/main.rs
Replaced automatic .version(VERSION_STR) clap builder with explicit --version/-V CLI argument. Added version string printing at start of main() before file processing. Implemented early-exit logic when --version flag is provided, preventing unnecessary file processing.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify version string format matches expected output: <package_name> <version_string>
  • Confirm early-exit logic correctly prevents file processing when --version is invoked
  • Validate no duplicate version printing occurs across clap help and runtime execution paths

Possibly related PRs

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed The PR implementation meets all acceptance criteria from issue #29: version is printed at start of execution, -V/--version flags are added, early exit for version-only requests occurs, and format matches the specification.
Out of Scope Changes check ✅ Passed All changes in src/main.rs are directly aligned with issue #29 requirements: version printing, flag addition, and early exit logic. No unrelated modifications detected.
Title check ✅ Passed The title accurately describes the main change: displaying version at the start of all CLI contexts with an empty line separator, which aligns with the primary objective of resolving issue #29.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 20251213_FIX_ISSUE_29

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nerdCopter nerdCopter changed the title feat: display version at start of all CLI contexts with empty line fix/feat: display version at start of all CLI contexts with empty line Dec 13, 2025
@nerdCopter nerdCopter merged commit 820ad97 into master Dec 13, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add version display to normal CLI execution (all contexts)

1 participant